package com.study.zzedu.ui.courseintroduce;


import android.support.v4.app.Fragment;

import com.study.zzedu.fragment.coursetab.CourseIntroduceFragment;
import com.study.zzedu.fragment.coursetab.TeachPlanFragment;
import com.study.zzedu.fragment.coursetab.TeachProgramFragment;

/**
 * Created by kiros on 2020/9/5.
 */

public class BaseTabForCourseFragment extends Fragment {
    private static final int TAB_ONE = 0;
    private static final int TAB_TWO = 1;
    private static final int TAB_THIRD = 2;
    private static final int TAB_FOUR = 3;

    public BaseTabForCourseFragment() {
    }


    public static Fragment newInstance(int position) {
        Fragment baseTabFragment;
        switch (position) {
            case TAB_ONE:
                baseTabFragment = new CourseIntroduceFragment();
                break;
            case TAB_TWO:
                baseTabFragment = new TeachProgramFragment();
                break;
            case TAB_THIRD:
                baseTabFragment = new TeachPlanFragment();
                break;
            default:
                baseTabFragment = new TeachPlanFragment();

        }
        return baseTabFragment;
    }

    @Override
    public void onDetach() {
        super.onDetach();
        getActivity().onBackPressed();
    }
}
